﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AbstractMq
{
    /// <summary>
    /// 订阅
    /// </summary>
    public interface ISubscriber:ISubscribeBase
    {
        /// <summary>
        /// 订阅
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="channelName">主题名</param>
        /// <param name="callback">回调函数</param>
        void Subscribe<T>(string channelName, Action<byte[]> callback) where T : class;

        /// <summary>
        /// 订阅
        /// </summary>
        /// <param name="channelName"></param>
        /// <param name="group"></param>
        /// <param name="callback"></param>
        void Subscribe(string channelName, string group, Action<byte[]> callback);
        /// <summary>
        /// 订阅
        /// </summary>
        /// <param name="channelName"></param>
        /// <param name="group"></param>
        /// <param name="callback"></param>
        void Subscribe(string exchangeName, string routingKey, string queueName, Action<byte[]> callback);

        void Subscribe(string exchangeName, string routingKey, string queueName, Func<byte[], bool> callback);
    }
}
